<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0, maximum-scale=1.0,user-scalable=no,minimal-ui">
    <title>校园点餐</title>
    <link rel="icon" href="./../images/favico.ico">
    <!--不同屏幕尺寸根字体设置-->
    <script src="./../js/base.js"></script>
    <!--element-ui的样式-->
    <link rel="stylesheet" href="../../backend/plugins/element-ui/index.css" />
    <!--引入vant样式-->
    <link rel="stylesheet" href="../styles/vant.min.css" />
    <!-- 引入样式  -->
    <link rel="stylesheet" href="../styles/index.css" />
    <!--本页面内容的样式-->
    <link rel="stylesheet" href="./../styles/address.css" />
    <link rel="stylesheet" href="./../styles/details.css" />
</head>

<body>
<div id="detail" class="app">
    <div class="divHead">
        <div class="divTitle">
            <i class="el-icon-arrow-left" @click="goBack"></i>个人信息管理
        </div>
    </div>
    <div class="divContent">
        <div class="divItem">
            <el-form-item label="用户名">
                <el-input v-model="form.name"></el-input>
            </el-form-item>
            <el-form-item label="性别">
                <el-radio-group v-model="form.resource">
                    <el-radio label="男"></el-radio>
                    <el-radio label="女"></el-radio>
                </el-radio-group>
            </el-form-item>
        </div>
    </div>
</div>
<!-- 开发环境版本,包含了有帮助的命令行警告 -->
<script src="../../backend/plugins/vue/vueMax.js"></script>
<!-- 引入组件库 -->
<script src="../../backend/plugins/element-ui/index.js"></script>
<!-- 引入vant样式 -->
<script src="./../js/vant.min.js"></script>
<script src="./../api/address.js"></script>
<!-- 引入axios -->
<script src="../../backend/plugins/axios/axios.min.js"></script>
<script src="./../js/request.js"></script>
<script>
    new Vue({
        el: "#detail",
        data() {
            return {
                addressList: [],
            }
        },
        computed: {},
        created() {
            this.initData()
        },
        mounted() {
        },
        methods: {
            goBack() {
                history.go(-1)
            },

            async initData() {
                const res = await getDetailsApi(id)
                if (res.code === 1) {
                    this.addressList = res.data
                } else {
                    this.$message.error(res.msg)
                }
            },
            async updateUserApi(item) {
                if (item.id) {
                    const res = await updateUserApi(this.form)
                    if (res.code === 1) {
                        this.initData(id)
                    } else {
                        this.$message.error(res.msg)
                    }
                }
            },
            itemClick(item) {
                const url = document.referrer
                //表示是从订单页面跳转过来的
                if (url.includes('user')) {
                    history.go(-1)
                }
            }

        }
    })
</script>
</body>

</html>
